package com.aspose.cells.a.d.a.a;

import java.awt.Color;
import java.awt.Rectangle;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.io.IOException;

public class zi extends com.aspose.cells.a.d.a.zg {
   private Rectangle b;
   private int c;
   private int d;
   private int e;
   private int f;
   private zo g;
   private int h;
   private int i;
   private AffineTransform j;
   private Color k;
   private int l;
   private BufferedImage m;

   public zi() {
      super(114, 1);
   }

   public void a(int var1, com.aspose.cells.a.d.a.zb var2) throws IOException {
      var2.a(this.b);
      var2.f(this.c);
      var2.f(this.d);
      var2.f(this.e);
      var2.f(this.f);
      boolean var3 = true;
      int var12 = this.m.getTransparency();
      switch(var12) {
      case 1:
         this.g.a(255);
         this.g.b(0);
         break;
      case 2:
         this.g.a(0);
         this.g.b(0);
         break;
      case 3:
         this.g.a(255);
         this.g.b(1);
      }

      this.g.a(var2);
      var2.f(this.h);
      var2.f(this.i);
      var2.a(this.j);
      var2.a(this.k);
      var2.b(this.l);
      var2.b(108);
      var2.b(40);
      var2.b(148);
      ColorModel var4 = this.m.getColorModel();
      boolean var5 = var4.hasAlpha();
      byte var6 = 4;
      String var7 = "*BGR";
      byte var8 = 24;
      if (var5) {
         var7 = "*BGRA";
         var6 = 1;
         var8 = 32;
      }

      byte[] var9 = com.aspose.cells.a.d.b.zb.a(this.m, this.k, var7, var6);
      var2.b(var9.length);
      var2.f(this.m.getWidth());
      var2.f(this.m.getHeight());
      byte var10 = 0;
      zn var11 = new zn(this.m.getWidth(), this.m.getHeight(), var8, var10, var9.length, 0, 0, 0, 0);
      var2.write(var11.a());
      var2.write(var9);
   }
}
